﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x020000AB RID: 171
	public class TElsifStmt : TCustomSqlStatement
	{
		// Token: 0x06000559 RID: 1369 RVA: 0x002FCEAE File Offset: 0x002FB0AE
		public TElsifStmt() : this(EDbVendor.dbvoracle)
		{
		}

		// Token: 0x0600055A RID: 1370 RVA: 0x002FCEB8 File Offset: 0x002FB0B8
		public TElsifStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sst_elsifstmt;
		}

		// Token: 0x0600055B RID: 1371 RVA: 0x002FCEC9 File Offset: 0x002FB0C9
		internal override void buildsql()
		{
		}

		// Token: 0x0600055C RID: 1372 RVA: 0x002FCECB File Offset: 0x002FB0CB
		internal override void clear()
		{
		}

		// Token: 0x0600055D RID: 1373 RVA: 0x002FCECD File Offset: 0x002FB0CD
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x0600055E RID: 1374 RVA: 0x002FCED4 File Offset: 0x002FB0D4
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x170000D7 RID: 215
		// (get) Token: 0x0600055F RID: 1375 RVA: 0x002FCED6 File Offset: 0x002FB0D6
		// (set) Token: 0x06000560 RID: 1376 RVA: 0x002FCEF1 File Offset: 0x002FB0F1
		public virtual TStatementList ThenStatements
		{
			get
			{
				if (this.thenStatements == null)
				{
					this.thenStatements = new TStatementList();
				}
				return this.thenStatements;
			}
			set
			{
				this.thenStatements = value;
			}
		}

		// Token: 0x170000D8 RID: 216
		// (get) Token: 0x06000561 RID: 1377 RVA: 0x002FCEFA File Offset: 0x002FB0FA
		// (set) Token: 0x06000562 RID: 1378 RVA: 0x002FCF02 File Offset: 0x002FB102
		public virtual TExpression Condition
		{
			get
			{
				return this.condition;
			}
			set
			{
				this.condition = value;
			}
		}

		// Token: 0x06000563 RID: 1379 RVA: 0x002FCF0B File Offset: 0x002FB10B
		public override void init(object arg1, object arg2)
		{
			this.condition = (TExpression)arg1;
			this.thenStmts = (TStatementListSqlNode)arg2;
		}

		// Token: 0x06000564 RID: 1380 RVA: 0x002FCF28 File Offset: 0x002FB128
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			base.doParseStatement(psql);
			this.condition.doParse(this, ESqlClause.unknown);
			this.thenStmts.doParse(this, ESqlClause.unknown);
			for (int i = 0; i < this.thenStmts.size(); i++)
			{
				this.ThenStatements.add(this.thenStmts.getStatementSqlNode(i).Stmt);
			}
			return 0;
		}

		// Token: 0x06000565 RID: 1381 RVA: 0x002FCF8A File Offset: 0x002FB18A
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000566 RID: 1382 RVA: 0x002FCF9A File Offset: 0x002FB19A
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.condition.acceptChildren(v);
			this.thenStatements.acceptChildren(v);
			v.postVisit(this);
		}

		// Token: 0x04001142 RID: 4418
		private TExpression condition;

		// Token: 0x04001143 RID: 4419
		private TStatementList thenStatements;

		// Token: 0x04001144 RID: 4420
		private TStatementListSqlNode thenStmts;
	}
}
